package za.org.jcicada.genss.sensor;

/**
 * ISensorObserver.java
 *
 * @author Simon Cross
 *
 * Created on November 11, 2008, 18:40
 */

import java.util.Set;

import za.org.jcicada.genss.ServiceURN;
import za.org.jcicada.genss.messages.Result;
import za.org.jcicada.genss.sensor.impl.SensorStatusValue;


/**
 * Observer for an ISensorSubject.
 *
 * @todo Decide what to do about updateSensorType (called on attaching to a
 * sensor to describe the sensor to the observer).
 */
public interface ISensorObserver {

    /**
     * Called after attaching to a list of sensors using ISensorSubject.attach().
     */
    void replyAttach(Result result, Set<SensorURN> sensorURNs);

    /**
     * Called after detaching from a list of sensors using ISensorSubject.detach().
     */
    void replyDetach(Result result, Set<SensorURN> sensorURNs);
    
    /**
     * Called after detaching from a list of sensors using ISensorSubject.detach().
     */
    void replySensorSet(Result result, int numSensors);
    
    /**
     * Called after setting a sensor sampling strategy
     */
    void replySetSamplingStrategy(Result result);

    /**
     * Notify the observer of an update to the sensor.
     */
    void informSensor(SensorURN sensorURN, ISensorValue value);
    
    /**
     * Notify the observer of an update to the sensor status.
     */
    void informSensorStatus(SensorURN sensorURN, SensorStatusValue statusValue);
    
    /**
     * Notify the observer of the sensor type.
     */
    void informSensorType(SensorURN sensorURN, ISensor sensor);
    
    /**
     * Notify the observer that its attachment has been terminated.
     */
    void informTerminateService(ServiceURN serviceURN);
    
    /**
     * Notify the observer that it has been disconnected from the subject.
     */
    void informDisconnect();

}
